home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 January: Mac OS SDK / Dev.CD Jan 98 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / AIncludes / MacWindows.a < prev    next >
Encoding:
Text File  |  1997-08-12  |  25.9 KB  |  870 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        MacWindows.a
  3. ;
  4. ;    Contains:    Window Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Release:    Universal Interfaces 3.0.1
  8. ;
  9. ;    Copyright:    © 1997 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        Please include the the file and version information (from above) with
  12. ;                the problem description.  Developers belonging to one of the Apple
  13. ;                developer programs can submit bug reports to:
  14. ;
  15. ;                    devsupport@apple.com
  16. ;
  17. ;
  18.     IF &TYPE('__MACWINDOWS__') = 'UNDEFINED' THEN
  19. __MACWINDOWS__ SET 1
  20.  
  21.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  22.     include 'Types.a'
  23.     ENDIF
  24.     IF &TYPE('__MIXEDMODE__') = 'UNDEFINED' THEN
  25.     include 'MixedMode.a'
  26.     ENDIF
  27.     IF &TYPE('__QUICKDRAW__') = 'UNDEFINED' THEN
  28.     include 'Quickdraw.a'
  29.     ENDIF
  30.     IF &TYPE('__EVENTS__') = 'UNDEFINED' THEN
  31.     include 'Events.a'
  32.     ENDIF
  33.     IF &TYPE('__CONTROLS__') = 'UNDEFINED' THEN
  34.     include 'Controls.a'
  35.     ENDIF
  36.  
  37.  
  38. ;  _________________________________________________________________________________________________________
  39. ;      
  40. ;   • WINDOW DEFINITION TYPE
  41. ;  _________________________________________________________________________________________________________
  42.  
  43.  
  44.  
  45. kWindowDefProcType                EQU        'WDEF'
  46.  
  47. ;  _________________________________________________________________________________________________________
  48. ;      
  49. ;   • WINDOW DEFINITION ID'S
  50. ;  _________________________________________________________________________________________________________
  51.  
  52.  
  53.  
  54.  
  55. kStandardWindowDefinition        EQU        0                    ; for document windows and dialogs
  56. kRoundWindowDefinition            EQU        1                    ; old da-style window
  57. kFloatingWindowDefinition        EQU        124                    ; for floating windows
  58.  
  59. ;  _________________________________________________________________________________________________________
  60. ;      
  61. ;   • VARIANT CODES
  62. ;  _________________________________________________________________________________________________________
  63.  
  64.  
  65.  
  66.  
  67.                                                             ; for use with kStandardWindowDefinition 
  68. kDocumentWindowVariantCode        EQU        0
  69. kModalDialogVariantCode            EQU        1
  70. kPlainDialogVariantCode            EQU        2
  71. kShadowDialogVariantCode        EQU        3
  72. kMovableModalDialogVariantCode    EQU        5
  73. kAlertVariantCode                EQU        7
  74. kMovableAlertVariantCode        EQU        9                    ; for use with kFloatingWindowDefinition 
  75. kSideFloaterVariantCode            EQU        8
  76.  
  77. ;  _________________________________________________________________________________________________________
  78. ;      
  79. ;   • PROC-ID'S
  80. ;  _________________________________________________________________________________________________________
  81.  
  82.  
  83.  
  84.  
  85. documentProc                    EQU        0
  86. dBoxProc                        EQU        1
  87. plainDBox                        EQU        2
  88. altDBoxProc                        EQU        3
  89. noGrowDocProc                    EQU        4
  90. movableDBoxProc                    EQU        5
  91. zoomDocProc                        EQU        8
  92. zoomNoGrow                        EQU        12
  93. rDocProc                        EQU        16                    ; floating window defproc ids 
  94. floatProc                        EQU        1985
  95. floatGrowProc                    EQU        1987
  96. floatZoomProc                    EQU        1989
  97. floatZoomGrowProc                EQU        1991
  98. floatSideProc                    EQU        1993
  99. floatSideGrowProc                EQU        1995
  100. floatSideZoomProc                EQU        1997
  101. floatSideZoomGrowProc            EQU        1999
  102.  
  103. ;  _________________________________________________________________________________________________________
  104. ;      
  105. ;   • STANDARD WINDOW KINDS
  106. ;  _________________________________________________________________________________________________________
  107.  
  108.  
  109.  
  110.  
  111. dialogKind                        EQU        2
  112. userKind                        EQU        8
  113. kDialogWindowKind                EQU        2
  114. kApplicationWindowKind            EQU        8
  115.  
  116.  
  117. ;  _________________________________________________________________________________________________________
  118. ;      
  119. ;   • FIND WINDOW RESULT CODES
  120. ;  _________________________________________________________________________________________________________
  121.  
  122.  
  123.  
  124.  
  125. inDesk                            EQU        0
  126. inNoWindow                        EQU        0
  127. inMenuBar                        EQU        1
  128. inSysWindow                        EQU        2
  129. inContent                        EQU        3
  130. inDrag                            EQU        4
  131. inGrow                            EQU        5
  132. inGoAway                        EQU        6
  133. inZoomIn                        EQU        7
  134. inZoomOut                        EQU        8
  135.  
  136. wDraw                            EQU        0
  137. wHit                            EQU        1
  138. wCalcRgns                        EQU        2
  139. wNew                            EQU        3
  140. wDispose                        EQU        4
  141. wGrow                            EQU        5
  142. wDrawGIcon                        EQU        6
  143.  
  144. deskPatID                        EQU        16
  145.  
  146. ;  _________________________________________________________________________________________________________
  147. ;      
  148. ;   • WINDOW DEFINITION HIT TEST RESULT CODES ("WINDOW PART")
  149. ;  _________________________________________________________________________________________________________
  150.  
  151.  
  152.  
  153.  
  154. wNoHit                            EQU        0
  155. wInContent                        EQU        1
  156. wInDrag                            EQU        2
  157. wInGrow                            EQU        3
  158. wInGoAway                        EQU        4
  159. wInZoomIn                        EQU        5
  160. wInZoomOut                        EQU        6
  161.  
  162. ;  _________________________________________________________________________________________________________
  163. ;      
  164. ;   • WINDOW COLOR PART CODES
  165. ;  _________________________________________________________________________________________________________
  166.  
  167.  
  168.  
  169.  
  170. wContentColor                    EQU        0
  171. wFrameColor                        EQU        1
  172. wTextColor                        EQU        2
  173. wHiliteColor                    EQU        3
  174. wTitleBarColor                    EQU        4
  175.  
  176. ;  _________________________________________________________________________________________________________
  177. ;   • WINDOW COLOR TABLE STRUCTURE
  178. ;  _________________________________________________________________________________________________________
  179.  
  180.  
  181.  
  182. WinCTab                    RECORD 0
  183. wCSeed                     ds.l    1                ; offset: $0 (0)        ;  reserved 
  184. wCReserved                 ds.w    1                ; offset: $4 (4)        ;  reserved 
  185. ctSize                     ds.w    1                ; offset: $6 (6)        ;  usually 4 for windows 
  186. ctTable                     ds.b    5 * ColorSpec.sizeof ; offset: $8 (8)
  187. sizeof                     EQU *                    ; size:   $30 (48)
  188.                         ENDR
  189. ; typedef struct WinCTab *                WCTabPtr
  190.  
  191. ; typedef WCTabPtr *                    WCTabHandle
  192.  
  193.  
  194. ;  _________________________________________________________________________________________________________
  195. ;   • WINDOWRECORD
  196. ;  _________________________________________________________________________________________________________
  197.  
  198.  
  199.  
  200.  
  201. ; typedef WindowRecord *                WindowPeek
  202.  
  203. WindowRecord            RECORD 0
  204. port                     ds        GrafPort        ; offset: $0 (0)
  205. windowKind                 ds.w    1                ; offset: $6C (108)
  206. visible                     ds.b    1                ; offset: $6E (110)
  207. hilited                     ds.b    1                ; offset: $6F (111)
  208. goAwayFlag                 ds.b    1                ; offset: $70 (112)
  209. spareFlag                 ds.b    1                ; offset: $71 (113)
  210. strucRgn                 ds.l    1                ; offset: $72 (114)
  211. contRgn                     ds.l    1                ; offset: $76 (118)
  212. updateRgn                 ds.l    1                ; offset: $7A (122)
  213. windowDefProc             ds.l    1                ; offset: $7E (126)
  214. dataHandle                 ds.l    1                ; offset: $82 (130)
  215. titleHandle                 ds.l    1                ; offset: $86 (134)
  216. titleWidth                 ds.w    1                ; offset: $8A (138)
  217. controlList                 ds.l    1                ; offset: $8C (140)
  218. nextWindow                 ds.l    1                ; offset: $90 (144)
  219. windowPic                 ds.l    1                ; offset: $94 (148)
  220. refCon                     ds.l    1                ; offset: $98 (152)
  221. sizeof                     EQU *                    ; size:   $9C (156)
  222.                         ENDR
  223.  
  224. ;  _________________________________________________________________________________________________________
  225. ;   • CWINDOWRECORD
  226. ;  _________________________________________________________________________________________________________
  227.  
  228.  
  229.  
  230.  
  231. ; typedef CWindowRecord *                CWindowPeek
  232.  
  233. CWindowRecord            RECORD 0
  234. port                     ds        CGrafPort        ; offset: $0 (0)
  235. windowKind                 ds.w    1                ; offset: $6C (108)
  236. visible                     ds.b    1                ; offset: $6E (110)
  237. hilited                     ds.b    1                ; offset: $6F (111)
  238. goAwayFlag                 ds.b    1                ; offset: $70 (112)
  239. spareFlag                 ds.b    1                ; offset: $71 (113)
  240. strucRgn                 ds.l    1                ; offset: $72 (114)
  241. contRgn                     ds.l    1                ; offset: $76 (118)
  242. updateRgn                 ds.l    1                ; offset: $7A (122)
  243. windowDefProc             ds.l    1                ; offset: $7E (126)
  244. dataHandle                 ds.l    1                ; offset: $82 (130)
  245. titleHandle                 ds.l    1                ; offset: $86 (134)
  246. titleWidth                 ds.w    1                ; offset: $8A (138)
  247. controlList                 ds.l    1                ; offset: $8C (140)
  248. nextWindow                 ds.l    1                ; offset: $90 (144)
  249. windowPic                 ds.l    1                ; offset: $94 (148)
  250. refCon                     ds.l    1                ; offset: $98 (152)
  251. sizeof                     EQU *                    ; size:   $9C (156)
  252.                         ENDR
  253.  
  254. ;  _________________________________________________________________________________________________________
  255. ;   • AUXWINDHANDLE
  256. ;  _________________________________________________________________________________________________________
  257.  
  258.  
  259.  
  260.  
  261. ; typedef AuxWinRec *                    AuxWinPtr
  262.  
  263. ; typedef AuxWinPtr *                    AuxWinHandle
  264.  
  265. AuxWinRec                RECORD 0
  266. awNext                     ds.l    1                ; offset: $0 (0)        ; handle to next AuxWinRec
  267. awOwner                     ds.l    1                ; offset: $4 (4)        ; ptr to window 
  268. awCTable                 ds.l    1                ; offset: $8 (8)        ; color table for this window
  269. reserved                 ds.l    1                ; offset: $C (12)
  270. awFlags                     ds.l    1                ; offset: $10 (16)        ; reserved for expansion
  271. awReserved                 ds.l    1                ; offset: $14 (20)        ; reserved for expansion
  272. awRefCon                 ds.l    1                ; offset: $18 (24)        ; user Constant
  273. sizeof                     EQU *                    ; size:   $1C (28)
  274.                         ENDR
  275.  
  276. ;  _________________________________________________________________________________________________________
  277. ;   • WSTATEHANDLE
  278. ;  _________________________________________________________________________________________________________
  279.  
  280.  
  281. WStateData                RECORD 0
  282. userState                 ds        Rect            ; offset: $0 (0)        ; user state
  283. stdState                 ds        Rect            ; offset: $8 (8)        ; standard state
  284. sizeof                     EQU *                    ; size:   $10 (16)
  285.                         ENDR
  286. ; typedef struct WStateData *            WStateDataPtr
  287.  
  288. ; typedef WStateDataPtr *                WStateDataHandle
  289.  
  290.  
  291. ;  _________________________________________________________________________________________________________
  292. ;      
  293. ;   • API
  294. ;  _________________________________________________________________________________________________________
  295.  
  296.  
  297. ;
  298. ; pascal void InitWindows(void )
  299. ;
  300.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  301.         _InitWindows:    OPWORD    $A912
  302.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  303.         IMPORT_CFM_FUNCTION InitWindows
  304.     ENDIF
  305.  
  306. ;
  307. ; pascal WindowPtr NewWindow(void *wStorage, const Rect *boundsRect, ConstStr255Param title, Boolean visible, short theProc, WindowPtr behind, Boolean goAwayFlag, long refCon)
  308. ;
  309.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  310.         _NewWindow:    OPWORD    $A913
  311.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  312.         IMPORT_CFM_FUNCTION NewWindow
  313.     ENDIF
  314.  
  315. ;
  316. ; pascal WindowPtr GetNewWindow(short windowID, void *wStorage, WindowPtr behind)
  317. ;
  318.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  319.         _GetNewWindow:    OPWORD    $A9BD
  320.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  321.         IMPORT_CFM_FUNCTION GetNewWindow
  322.     ENDIF
  323.  
  324. ;
  325. ; pascal WindowPtr NewCWindow(void *wStorage, const Rect *boundsRect, ConstStr255Param title, Boolean visible, short procID, WindowPtr behind, Boolean goAwayFlag, long refCon)
  326. ;
  327.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  328.         _NewCWindow:    OPWORD    $AA45
  329.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  330.         IMPORT_CFM_FUNCTION NewCWindow
  331.     ENDIF
  332.  
  333. ;
  334. ; pascal void DisposeWindow(WindowPtr theWindow)
  335. ;
  336.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  337.         _DisposeWindow:    OPWORD    $A914
  338.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  339.         IMPORT_CFM_FUNCTION DisposeWindow
  340.     ENDIF
  341.  
  342. ;
  343. ; pascal void CloseWindow(WindowPtr theWindow)
  344. ;
  345.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  346.         _CloseWindow:    OPWORD    $A92D
  347.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  348.         IMPORT_CFM_FUNCTION CloseWindow
  349.     ENDIF
  350.  
  351. ;
  352. ; pascal void InvalRect(const Rect *badRect)
  353. ;
  354.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  355.         _InvalRect:    OPWORD    $A928
  356.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  357.         IMPORT_CFM_FUNCTION InvalRect
  358.     ENDIF
  359.  
  360. ;
  361. ; pascal void InvalRgn(RgnHandle badRgn)
  362. ;
  363.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  364.         _InvalRgn:    OPWORD    $A927
  365.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  366.         IMPORT_CFM_FUNCTION InvalRgn
  367.     ENDIF
  368.  
  369. ;
  370. ; pascal void ValidRect(const Rect *goodRect)
  371. ;
  372.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  373.         _ValidRect:    OPWORD    $A92A
  374.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  375.         IMPORT_CFM_FUNCTION ValidRect
  376.     ENDIF
  377.  
  378. ;
  379. ; pascal void ValidRgn(RgnHandle goodRgn)
  380. ;
  381.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  382.         _ValidRgn:    OPWORD    $A929
  383.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  384.         IMPORT_CFM_FUNCTION ValidRgn
  385.     ENDIF
  386.  
  387. ;
  388. ; pascal Boolean CheckUpdate(EventRecord *theEvent)
  389. ;
  390.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  391.         _CheckUpdate:    OPWORD    $A911
  392.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  393.         IMPORT_CFM_FUNCTION CheckUpdate
  394.     ENDIF
  395.  
  396. ;
  397. ; pascal void ClipAbove(WindowPtr window)
  398. ;
  399.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  400.         _ClipAbove:    OPWORD    $A90B
  401.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  402.         IMPORT_CFM_FUNCTION ClipAbove
  403.     ENDIF
  404.  
  405. ;
  406. ; pascal void SaveOld(WindowPtr window)
  407. ;
  408.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  409.         _SaveOld:    OPWORD    $A90E
  410.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  411.         IMPORT_CFM_FUNCTION SaveOld
  412.     ENDIF
  413.  
  414. ;
  415. ; pascal void DrawNew(WindowPtr window, Boolean update)
  416. ;
  417.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  418.         _DrawNew:    OPWORD    $A90F
  419.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  420.         IMPORT_CFM_FUNCTION DrawNew
  421.     ENDIF
  422.  
  423. ;
  424. ; pascal void PaintOne(WindowPtr window, RgnHandle clobberedRgn)
  425. ;
  426.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  427.         _PaintOne:    OPWORD    $A90C
  428.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  429.         IMPORT_CFM_FUNCTION PaintOne
  430.     ENDIF
  431.  
  432. ;
  433. ; pascal void PaintBehind(WindowPtr startWindow, RgnHandle clobberedRgn)
  434. ;
  435.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  436.         _PaintBehind:    OPWORD    $A90D
  437.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  438.         IMPORT_CFM_FUNCTION PaintBehind
  439.     ENDIF
  440.  
  441. ;
  442. ; pascal void CalcVis(WindowPtr window)
  443. ;
  444.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  445.         _CalcVis:    OPWORD    $A909
  446.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  447.         IMPORT_CFM_FUNCTION CalcVis
  448.     ENDIF
  449.  
  450. ;
  451. ; pascal void CalcVisBehind(WindowPtr startWindow, RgnHandle clobberedRgn)
  452. ;
  453.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  454.         _CalcVisBehind:    OPWORD    $A90A
  455.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  456.         IMPORT_CFM_FUNCTION CalcVisBehind
  457.     ENDIF
  458.  
  459. ;
  460. ; pascal void SetWinColor(WindowPtr theWindow, WCTabHandle newColorTable)
  461. ;
  462.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  463.         _SetWinColor:    OPWORD    $AA41
  464.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  465.         IMPORT_CFM_FUNCTION SetWinColor
  466.     ENDIF
  467.  
  468. ;
  469. ; pascal void SetDeskCPat(PixPatHandle deskPixPat)
  470. ;
  471.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  472.         _SetDeskCPat:    OPWORD    $AA47
  473.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  474.         IMPORT_CFM_FUNCTION SetDeskCPat
  475.     ENDIF
  476.  
  477. ;
  478. ; pascal WindowPtr GetNewCWindow(short windowID, void *wStorage, WindowPtr behind)
  479. ;
  480.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  481.         _GetNewCWindow:    OPWORD    $AA46
  482.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  483.         IMPORT_CFM_FUNCTION GetNewCWindow
  484.     ENDIF
  485.  
  486. ;
  487. ; pascal void SetWTitle(WindowPtr theWindow, ConstStr255Param title)
  488. ;
  489.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  490.         _SetWTitle:    OPWORD    $A91A
  491.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  492.         IMPORT_CFM_FUNCTION SetWTitle
  493.     ENDIF
  494.  
  495. ;
  496. ; pascal void GetWTitle(WindowPtr theWindow, Str255 title)
  497. ;
  498.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  499.         _GetWTitle:    OPWORD    $A919
  500.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  501.         IMPORT_CFM_FUNCTION GetWTitle
  502.     ENDIF
  503.  
  504. ;
  505. ; pascal void GetWMgrPort(GrafPtr *wPort)
  506. ;
  507.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  508.         _GetWMgrPort:    OPWORD    $A910
  509.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  510.         IMPORT_CFM_FUNCTION GetWMgrPort
  511.     ENDIF
  512.  
  513. ;
  514. ; pascal void GetCWMgrPort(CGrafPtr *wMgrCPort)
  515. ;
  516.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  517.         _GetCWMgrPort:    OPWORD    $AA48
  518.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  519.         IMPORT_CFM_FUNCTION GetCWMgrPort
  520.     ENDIF
  521.  
  522. ;
  523. ; pascal void SetWRefCon(WindowPtr theWindow, long data)
  524. ;
  525.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  526.         _SetWRefCon:    OPWORD    $A918
  527.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  528.         IMPORT_CFM_FUNCTION SetWRefCon
  529.     ENDIF
  530.  
  531. ;
  532. ; pascal long GetWRefCon(WindowPtr theWindow)
  533. ;
  534.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  535.         _GetWRefCon:    OPWORD    $A917
  536.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  537.         IMPORT_CFM_FUNCTION GetWRefCon
  538.     ENDIF
  539.  
  540. ;
  541. ; pascal void SelectWindow(WindowPtr theWindow)
  542. ;
  543.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  544.         _SelectWindow:    OPWORD    $A91F
  545.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  546.         IMPORT_CFM_FUNCTION SelectWindow
  547.     ENDIF
  548.  
  549. ;
  550. ; pascal void HideWindow(WindowPtr theWindow)
  551. ;
  552.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  553.         _HideWindow:    OPWORD    $A916
  554.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  555.         IMPORT_CFM_FUNCTION HideWindow
  556.     ENDIF
  557.  
  558. ;
  559. ; pascal void ShowWindow(WindowPtr theWindow)
  560. ;
  561.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  562.         _ShowWindow:    OPWORD    $A915
  563.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  564.         IMPORT_CFM_FUNCTION ShowWindow
  565.     ENDIF
  566.  
  567. ;
  568. ; pascal void ShowHide(WindowPtr theWindow, Boolean showFlag)
  569. ;
  570.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  571.         _ShowHide:    OPWORD    $A908
  572.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  573.         IMPORT_CFM_FUNCTION ShowHide
  574.     ENDIF
  575.  
  576. ;
  577. ; pascal void HiliteWindow(WindowPtr theWindow, Boolean fHilite)
  578. ;
  579.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  580.         _HiliteWindow:    OPWORD    $A91C
  581.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  582.         IMPORT_CFM_FUNCTION HiliteWindow
  583.     ENDIF
  584.  
  585. ;
  586. ; pascal void BringToFront(WindowPtr theWindow)
  587. ;
  588.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  589.         _BringToFront:    OPWORD    $A920
  590.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  591.         IMPORT_CFM_FUNCTION BringToFront
  592.     ENDIF
  593.  
  594. ;
  595. ; pascal void SendBehind(WindowPtr theWindow, WindowPtr behindWindow)
  596. ;
  597.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  598.         _SendBehind:    OPWORD    $A921
  599.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  600.         IMPORT_CFM_FUNCTION SendBehind
  601.     ENDIF
  602.  
  603. ;
  604. ; pascal WindowPtr FrontWindow(void )
  605. ;
  606.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  607.         _FrontWindow:    OPWORD    $A924
  608.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  609.         IMPORT_CFM_FUNCTION FrontWindow
  610.     ENDIF
  611.  
  612. ;
  613. ; pascal void DrawGrowIcon(WindowPtr theWindow)
  614. ;
  615.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  616.         _DrawGrowIcon:    OPWORD    $A904
  617.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  618.         IMPORT_CFM_FUNCTION DrawGrowIcon
  619.     ENDIF
  620.  
  621. ;
  622. ; pascal void MoveWindow(WindowPtr theWindow, short hGlobal, short vGlobal, Boolean front)
  623. ;
  624.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  625.         _MoveWindow:    OPWORD    $A91B
  626.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  627.         IMPORT_CFM_FUNCTION MoveWindow
  628.     ENDIF
  629.  
  630. ;
  631. ; pascal void SizeWindow(WindowPtr theWindow, short w, short h, Boolean fUpdate)
  632. ;
  633.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  634.         _SizeWindow:    OPWORD    $A91D
  635.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  636.         IMPORT_CFM_FUNCTION SizeWindow
  637.     ENDIF
  638.  
  639. ;
  640. ; pascal void ZoomWindow(WindowPtr theWindow, short partCode, Boolean front)
  641. ;
  642.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  643.         _ZoomWindow:    OPWORD    $A83A
  644.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  645.         IMPORT_CFM_FUNCTION ZoomWindow
  646.     ENDIF
  647.  
  648. ;
  649. ; pascal void BeginUpdate(WindowPtr theWindow)
  650. ;
  651.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  652.         _BeginUpdate:    OPWORD    $A922
  653.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  654.         IMPORT_CFM_FUNCTION BeginUpdate
  655.     ENDIF
  656.  
  657. ;
  658. ; pascal void EndUpdate(WindowPtr theWindow)
  659. ;
  660.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  661.         _EndUpdate:    OPWORD    $A923
  662.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  663.         IMPORT_CFM_FUNCTION EndUpdate
  664.     ENDIF
  665.  
  666. ;
  667. ; pascal void SetWindowPic(WindowPtr theWindow, PicHandle pic)
  668. ;
  669.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  670.         _SetWindowPic:    OPWORD    $A92E
  671.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  672.         IMPORT_CFM_FUNCTION SetWindowPic
  673.     ENDIF
  674.  
  675. ;
  676. ; pascal PicHandle GetWindowPic(WindowPtr theWindow)
  677. ;
  678.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  679.         _GetWindowPic:    OPWORD    $A92F
  680.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  681.         IMPORT_CFM_FUNCTION GetWindowPic
  682.     ENDIF
  683.  
  684. ;
  685. ; pascal long GrowWindow(WindowPtr theWindow, Point startPt, const Rect *bBox)
  686. ;
  687.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  688.         _GrowWindow:    OPWORD    $A92B
  689.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  690.         IMPORT_CFM_FUNCTION GrowWindow
  691.     ENDIF
  692.  
  693. ;
  694. ; pascal short FindWindow(Point thePoint, WindowPtr *theWindow)
  695. ;
  696.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  697.         _FindWindow:    OPWORD    $A92C
  698.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  699.         IMPORT_CFM_FUNCTION FindWindow
  700.     ENDIF
  701.  
  702. ;
  703. ; pascal long PinRect(const Rect *theRect, Point thePt)
  704. ;
  705.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  706.         _PinRect:    OPWORD    $A94E
  707.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  708.         IMPORT_CFM_FUNCTION PinRect
  709.     ENDIF
  710.  
  711. ;
  712. ; pascal long DragGrayRgn(RgnHandle theRgn, Point startPt, const Rect *limitRect, const Rect *slopRect, short axis, DragGrayRgnUPP actionProc)
  713. ;
  714.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  715.         _DragGrayRgn:    OPWORD    $A905
  716.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  717.         IMPORT_CFM_FUNCTION DragGrayRgn
  718.     ENDIF
  719.  
  720. ;
  721. ; pascal long DragTheRgn(RgnHandle theRgn, Point startPt, const Rect *limitRect, const Rect *slopRect, short axis, DragGrayRgnUPP actionProc)
  722. ;
  723.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  724.         _DragTheRgn:    OPWORD    $A926
  725.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  726.         IMPORT_CFM_FUNCTION DragTheRgn
  727.     ENDIF
  728.  
  729. ;
  730. ; pascal Boolean TrackBox(WindowPtr theWindow, Point thePt, short partCode)
  731. ;
  732.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  733.         _TrackBox:    OPWORD    $A83B
  734.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  735.         IMPORT_CFM_FUNCTION TrackBox
  736.     ENDIF
  737.  
  738. ;
  739. ; pascal Boolean TrackGoAway(WindowPtr theWindow, Point thePt)
  740. ;
  741.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  742.         _TrackGoAway:    OPWORD    $A91E
  743.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  744.         IMPORT_CFM_FUNCTION TrackGoAway
  745.     ENDIF
  746.  
  747. ;
  748. ; pascal void DragWindow(WindowPtr theWindow, Point startPt, const Rect *boundsRect)
  749. ;
  750.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  751.         _DragWindow:    OPWORD    $A925
  752.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  753.         IMPORT_CFM_FUNCTION DragWindow
  754.     ENDIF
  755.  
  756. ;
  757. ; pascal short GetWVariant(WindowPtr theWindow)
  758. ;
  759.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  760.         _GetWVariant:    OPWORD    $A80A
  761.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  762.         IMPORT_CFM_FUNCTION GetWVariant
  763.     ENDIF
  764.  
  765. ;
  766. ; pascal Boolean GetAuxWin(WindowPtr theWindow, AuxWinHandle *awHndl)
  767. ;
  768.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  769.         _GetAuxWin:    OPWORD    $AA42
  770.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  771.         IMPORT_CFM_FUNCTION GetAuxWin
  772.     ENDIF
  773.  
  774. ;
  775. ; pascal RgnHandle GetGrayRgn(void)
  776. ;
  777.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  778.         Macro
  779.         _GetGrayRgn           &dest=(sp)
  780.             move.l            $09EE,&dest
  781.         EndM
  782.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  783.         IMPORT_CFM_FUNCTION GetGrayRgn
  784.     ENDIF
  785.  
  786.  
  787. ;  _________________________________________________________________________________________________________
  788. ;      
  789. ;   • PROCS
  790. ;  _________________________________________________________________________________________________________
  791.  
  792.  
  793.  
  794.  
  795. ;  _________________________________________________________________________________________________________
  796. ;      
  797. ;   • C GLUE
  798. ;  _________________________________________________________________________________________________________
  799.  
  800.  
  801.  
  802. ;  _________________________________________________________________________________________________________
  803. ;      
  804. ;   • WindowRecord accessor macros
  805. ;  _________________________________________________________________________________________________________
  806.  
  807.  
  808. ;    *****************************************************************************
  809. ;    *                                                                           *
  810. ;    * The conditional STRICT_WINDOWS has been removed from this interface file. *
  811. ;    * The accessor macros to a WindowRecord are no longer necessary.            *
  812. ;    *                                                                           *
  813. ;    * All ≈Ref Types have reverted to their original Handle and Ptr Types.      *
  814. ;    *                                                                           *
  815. ;    *****************************************************************************
  816. ;
  817. ;    Details:
  818. ;    The original purpose of the STRICT_ conditionals and accessor macros was to
  819. ;    help ease the transition to Copland.  Shared data structures are difficult
  820. ;    to coordinate in a preemptive multitasking OS.  By hiding the fields in a
  821. ;    WindowRecord and other data structures, we would begin the migration to the
  822. ;    discipline wherein system data structures are completely hidden from
  823. ;    applications.
  824. ;    
  825. ;    After many design reviews, we finally concluded that with this sort of
  826. ;    migration, the system could never tell when an application was no longer
  827. ;    peeking at a WindowRecord, and thus the data structure might never become
  828. ;    system owned.  Additionally, there were many other limitations in the
  829. ;    classic toolbox that were begging to be addressed.  The final decision was
  830. ;    to leave the traditional toolbox as a compatibility mode.
  831. ;    
  832. ;    We also decided to use the Handle and Ptr based types in the function
  833. ;    declarations.  For example, NewWindow now returns a WindowPtr rather than a
  834. ;    WindowRef.  The Ref types are still defined in the header files, so all
  835. ;    existing code will still compile exactly as it did before.  There are
  836. ;    several reasons why we chose to do this:
  837. ;    
  838. ;    - The importance of backwards compatibility makes it unfeasible for us to
  839. ;    enforce real opaque references in the implementation anytime in the
  840. ;    foreseeable future.  Therefore, any opaque data types (e.g. WindowRef,
  841. ;    ControlRef, etc.) in the documentation and header files would always be a
  842. ;    fake veneer of opacity.
  843. ;    
  844. ;    - There exists a significant base of books and sample code that neophyte
  845. ;    Macintosh developers use to learn how to program the Macintosh.  These
  846. ;    books and sample code all use direct data access.  Introducing opaque data
  847. ;    types at this point would confuse neophyte programmers more than it would
  848. ;    help them.
  849. ;    
  850. ;    - Direct data structure access is used by nearly all Macintosh developers. 
  851. ;    Changing the interfaces to reflect a false opacity would not provide any
  852. ;    benefit to these developers.
  853. ;    
  854. ;    - Accessor functions are useful in and of themselves as convenience
  855. ;    functions, without being tied to opaque data types.  We will complete and
  856. ;    document the Windows and Dialogs accessor functions in an upcoming release
  857. ;    of the interfaces.
  858. ;
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.  
  866.  
  867.     ENDIF ; __MACWINDOWS__ 
  868.  
  869.